﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

namespace PIT.Labs.ProjectRepository.Owl2DotNet.Xsd
{
    class XsdEntityBase : IEntity
    {
        Dictionary<IAnnotationProperty, IValue> annotations;

        protected XsdOntology ontology;

        public XsdEntityBase(XsdOntology o, string uri)
        {
            annotations = new Dictionary<IAnnotationProperty, IValue>();
            ontology = o;
            Uri = new Uri(uri);
            Label = Uri.Fragment;
        }

        public Uri Uri
        {
            get;
            set;
        }

        public string Label
        {
            get;
            set;
        }

        public IDictionary<IAnnotationProperty, IValue> Annotations
        {
            get { return annotations; }
        }


        public IOntology Ontology
        {
            get { return ontology; }
        }

        public override string ToString()
        {
            return String.Format(CultureInfo.InvariantCulture, "{0} ({1}, {2})", Label, Uri, this.GetType().Name);
        }
    }
}
